/**
 * @author Chris Hanshew
 * 
 * A class that represents a comparable student 
 */
package cs241.assignment8.priorityqueue;

import org.apache.commons.lang.builder.CompareToBuilder;

public class Student implements Comparable<Student>{

	private String name;
	private float GPA;
	private float donation;
	private int isFourBear;
	private int isAthlete;
	
	public Student(){}
	
	public String getName() {
		return name;
	}
	public float getGPA() {
		return GPA;
	}
	public float getDonation() {
		return donation;
	}
	public int getIsFourBear() {
		return isFourBear;
	}
	public int getIsAthlete() {
		return isAthlete;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setGPA(float gpa) {
		GPA = gpa;
	}
	public void setDonation(float donation) {
		this.donation = donation;
	}
	public void setIsFourBear(int isFourBear) {
		this.isFourBear = isFourBear;
	}
	public void setIsAthlete(int isAthlete) {
		this.isAthlete = isAthlete;
	}
	
	public String toString(){
		return this.getName();
	}

	public int compareTo(Student o) {
		Student student = o;
		int compare = 0;
		
		if(this.isFourBear == student.isFourBear){
			
			//Determine Athlete
			if(this.isAthlete == student.isAthlete){
				
				//Determine GPA
				if(this.GPA == student.getGPA()){
					
					//Determine Donation
					if(this.donation == student.getDonation()){
						compare = 0;
					}else{
						compare = (this.donation > student.getDonation()) ? 1 : -1;
					}
					
				}else{
					compare = (this.GPA > student.getGPA()) ? 1 : -1;
				}
			}else{
				compare = (this.isAthlete > student.getIsAthlete()) ? 1 : -1;
			}
		}else{
			compare = (this.isFourBear > student.getIsFourBear()) ? 1 : -1;
		}
		return compare;
	}
}
